<?php

//print_r($_POST);

require_once 'html/htmlHelper.php';
require_once 'mysql/dbHelper.php';
require_once 'fileIO/fileHelper.php';
require_once 'classes/financialClass.php';
require_once 'controller/projectControllerClass.php';

//testMultiyearProject();
//testProjectObject();
testUploadFile();
function testProjectObject(){
    $projectResult = getAllFieldsInTableGiveAnID("project", "projectID", 60);    
    $projectObject = new projectControllerClass($projectResult, 3);
    echo $projectObject->tasks[0]->toString();
   
}

function testUploadFile(){
    echo '<html>
            <body>
               <form action="upload_file.php" method="post" enctype="multipart/form-data">
               <table><tr>
                <td><label for="file">Filename:</label></td>
                <td><input type="file" name="file" id="file"></td>
                <td><input type="submit" name="submit" value="Submit">';
     echo getHiddenField("projectID", "5");
     echo'          </td></table></form>
            </body>
          </html>';
}
function testMultiyearProject() {
    //DuplicateMySQLRecord("project", "projectID", 32, 115);
    //return;
    $obj = new financialClass("2015-1-06", "2015-10-27", "10000", "100", "2015");
    $obj->initialize();
    //$obj->printArray($obj->curYearDuration);
}

function getReqListBox($result) {
    $size = $result->num_rows;
    echo"
                 <select name = \"reqList\" id=\"a\" size=\"$size\" multiple=\"\">";
    $counter = 0;
    while ($row = mysqli_fetch_array($result)) {
        $reqName = $row['description'];
        echo "<option value=\"$counter\">$reqName</option>";
    }

//	<option value=\"a\">Afghanistan</option>
//	<option value=\"b\">Bahamas</option>
//	<option value=\"c\">Barbados</option>
//	<option value=\"d\">Belgium</option>
//	<option value=\"e\">Bhutan</option>
//	<option value=\"f\">China</option>
//	<option value=\"g\">Croatia</option>
//	<option value=\"h\">Denmark</option>
//	<option value=\"i\">France</option>
    echo"
</select>
<br><br>
Move
<input type=\"button\" value = \"Up\" onclick=\"listbox_move('a', 'up')\">
<input type=\"button\" value = \"Down\" onclick=\"listbox_move('a', 'down')\">
</br></br>";

    echo "<input type=\"hidden\" id=\"hiddenList\" value=\"hiddenList\" name=\"hiddenList\">";
    echo getFormInputElement('submit', 'submit', "100%", "Submit Priority Changes", "ColectSel('a','hiddenList')");
}

?>
